/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session;

import java.sql.*;
import java.util.*;

public class TableBean {
    Connection con ;
    Statement ps;
    ResultSet rs;
   
    private List perInfoAll = new ArrayList();

    public void setPerInfoAll(List perInfoAll) {
        this.perInfoAll = perInfoAll;
    }
    
    public List getPerInfoAll() {
        int i = 0;
       
        try{
            
            Class.forName("com.mysql.jdbc.Driver");
            
            con = DriverManager.getConnection("jdbc:mysql://localhost:3306/oracle","root","city123");
            
            ps = con.createStatement();
            
            rs = ps.executeQuery("select cedula from datos");
            
            while(rs.next()){
                perInfoAll.add(i,new tableData(rs.getString("cedula")));
                i++;
            }
            
        } catch (Exception e) {
            System.out.println("Error Data : " + e.getMessage());
        } 
        return perInfoAll;
        
    }
    
    
    
    
    
    public class tableData {
       
        private String cedula;

        public String getCedula() {
            return cedula;
        }

        public void setCedula(String cedula) {
            this.cedula = cedula;
        }
        
       
        
        public tableData(String cedula) {
            this.cedula = cedula;
        }            

       
    }
}
